package com.iran.sort;

import java.util.Arrays;
import java.util.HashMap;

public class SelectionSort {
    public static void main(String[] args) {
        int[] arr = {2, 3, 56, 7, 2, 43, 55, 77, 88, 99};
        for (int i = 0; i < arr.length - 1; i++) {
            int minIndex = i;
            for (int j = i + 1; j < arr.length; j++) {
                if (arr[j] < arr[minIndex]) {
                    minIndex = j;
                }
            }
            int temp = arr[i];
            arr[i] = arr[minIndex];
            arr[minIndex] = temp;
        }
        Arrays.stream(arr).forEach(System.out::println);
    }

    static void selectionSort(int[] arr) {

    }
}
